import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkDaRenApplyVO, SkDaRenApplyForm, SkDaRenApplyQuery } from '@/api/app/SkDaRenApply/types';

/**
 * 查询达人申请信息列表
 * @param query
 * @returns {*}
 */

export const listSkDaRenApply = (query?: SkDaRenApplyQuery): AxiosPromise<SkDaRenApplyVO[]> => {
  return request({
    url: '/app/SkDaRenApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询达人申请信息详细
 * @param id
 */
export const getSkDaRenApply = (id: string | number): AxiosPromise<SkDaRenApplyVO> => {
  return request({
    url: '/app/SkDaRenApply/' + id,
    method: 'get'
  });
};

/**
 * 新增达人申请信息
 * @param data
 */
export const addSkDaRenApply = (data: SkDaRenApplyForm) => {
  return request({
    url: '/app/SkDaRenApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改达人申请信息
 * @param data
 */
export const updateSkDaRenApply = (data: SkDaRenApplyForm) => {
  return request({
    url: '/app/SkDaRenApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除达人申请信息
 * @param id
 */
export const delSkDaRenApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkDaRenApply/' + id,
    method: 'delete'
  });
};
